Skip to content

Fix Lua API tests #153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Fix Lua API tests #153

wants to merge 7 commits into from

Conversation

ligurio
Copy link
Owner

@ligurio ligurio commented Aug 6, 2025

No description provided.

ligurio added 6 commits August 7, 2025 09:48
Fix out-of-bound indices passed to `table.remove()`.
The patch fixes the following issues:

- `string.char()` returns the internal numeric codes of the
  characters, not a single number.
- `string.char()` returns `nil` when values `i` or `j` are
   outside the acceptable range (less than zero and greater than
   the length of the string). It is not documented.
The patch fixes description (synopsis is at the end of the
description) and fixes lower boundary for `n`, with `n` equal
to zero assertion calculates negative number in right part of
expression.
The patch changes function `random_locale()`, so it builds a table
with locales only once on the first execution and then returns
a cached table.
The patcha adds a test for `table.clear()` function that is
present in LuaJIT. Follows up the commit ee032e7
("tests/lapi: add table tests").
@ligurio ligurio force-pushed the ligurio/gh-xxxx-fix-lapi-tests-2 branch from 9c77028 to 68047ba Compare August 7, 2025 08:18
@ligurio ligurio requested a review from Buristan August 7, 2025 10:01
@ligurio ligurio assigned ligurio and Buristan and unassigned ligurio Aug 7, 2025
The patch updates assertions for values returned by `os.date()`
and `os.time()`, LuaJIT-specific type checks moved under condition.
@ligurio ligurio force-pushed the ligurio/gh-xxxx-fix-lapi-tests-2 branch from 5ac345f to 42fa96a Compare August 8, 2025 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants